{template 'space', 'header'}
<link href="{SKIN_PATH}modal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="images/js/jqModal.js"></script>
<script type="text/javascript" src="{$M[url]}images/js/space.js"></script>
<div id="main">
  <div id="left">
    <div id="space">
      <h5>个人资料</h5>
      <img src="{$avatar}" alt="{$username}" height="150" width="150"/>
      <div id="memberinfo">
       <p>
	  用户名：<a href="{$MODULE[member][url]}view.php?userid={$userid}">{$username}</a><br />
	  最后登录：{date('Y-m-d H:i', $lastlogintime)}
	  </p>
    </div>
      <ol>{if $is_host}<li class="msg"><a href="{$MODULE[message][url]}inbox.php" class="msg">查看短消息</a></li>{/if}<li class="edit"><a href="{$MODULE[message][url]}send.php?userid={$userid}" class="edit">写短消息</a></li></ol>
      <div class="clear"></div>
    </div>
    <ol>
      <li class="local"><a href="{SITE_URL}">返回网站首页</a></li>
      {if $is_host}<li class="exit"><a href="{$MODULE[member][url]}logout.php">退出登录</a></li>{/if}
    </ol>
  </div>
  <div id="right">
  {if $is_host}<div id="model"><a href="javascript:void(0);" class="blockcontrol" id="blockcontrol">空间管理</a></div>{/if}
	<p id="position"> <strong>当前位置：</strong><a href="">首页</a>{$spacename}</p>
    {loop $blockinfo $i $api}
    <div id="block_{$api['apiid']}" class="modellist_2">
      <h3>
        <span class="f_r"><a href="#" id="more_url_{$api['apiid']}"><img src="images/more.gif" alt="更多"/></a></span>
        {$api[name]}{if $is_host}&nbsp;<a href="javascript:void(0);" onClick="javascript:close_block('{$api['apiid']}');" style="font-size:12px; font-weight:normal; margin-left:15px;">[关闭]</a>{/if}
      </h3>
	 
      <div id="block_pic_{$api['apiid']}" class="modellist_2_1">
      </div>
      <div id="block_words_{$api['apiid']}" class="modellist_2_2">
      </div>
      <div class="clear"></div>
    </div>
    {/loop}
  </div>
</div>
<div class="clear"></div>
<span id="toggle_pannel"></span>
{template 'member', 'footer'}
<script language="javascript">
url = "{$M[url]}block.php?userid={$_userid}"
$('#toggle_pannel').jqm({ajax:url,modal:false,trigger: 'a.blockcontrol'});
{loop $blockinfo $i $api}
	block({$api['apiid']}, "{$api['url']}", {$userid})
{/loop}

function close_block(id)
{
	$.get("{$M[url]}block.php", {action:'del', userid:{$_userid}, blockid: id}, function(data) {
		});
	id = '#block_' + id;
	$(id).hide();
}
</script>